import type {
  FlowExportObject,
  Edge as VFEdge,
  Node as VFNode,
} from "@vue-flow/core";

export default defineEventHandler(async (_event): Promise<ReplyFineOrNot<FlowExportObject>> => {
  const storage = useStorage("data");
  const flow = await storage.getItem("flow");
  console.log("flow", typeof flow);

  if (typeof flow === "object") {
    const data = flow as FlowExportObject;
    return { msg: "ok", data };
  }
  return { msg: "no data" };
});
